#{extends 'Users/frame.html' /}

#{set 'moreStyles'}
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/Users/edit.scss'}" />
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/navigationbar.scss'}" />
#{/set}
<script language="javascript">
$(function(){
	$("#mi_editPassword").addClass("menu-select");
});
</script>
<div class="navigationBar">
	<table>
		<tr>
			<td><img src="@{'/public/images/navigationHouse.gif'}"></td>
			<td><strong>当前位置：</strong></td>
			<td>
				<a href="/">首页</a>
				>>
				<a href="/users">会员中心</a>
				>>
				<font class="current">密码修改</font>
			</td>
		</tr>
	</table>
</div>
<script language="javascript">
$(function(){
	var validateResult = "#{error 'validateRestle'/}";
	if(validateResult == "SUCC") {
		alert("用户密码修改成功。");
	}
});
</script>
<div id="edit-comment">
	<table>
		#{form @users.updatePassword(), name:'form1', id:'form1'}
		<tr>
			<input type="hidden" name="id" value="${user.id}">
			<td class="left">用户名：</td>
			<td class="right">
				<strong class="red">${user.username}</strong>
			</td>
		</tr>
		<tr>
			<td class="left">旧密码：</td>
			<td class="right">
				<input type="password" name="oldpassword" id="oldpassword" value="${oldpassword}" />
				<font class="red">*</font>&nbsp;
				<span class="error">#{error 'oldpassword' /}</span>
			</td>
		</tr>
		<tr>
			<td class="left">新密码：</td>
			<td class="right">
				<input type="password" name="newpassword" id="newpassword" value="${newpassword}" />
				<font class="red">*</font>&nbsp;
				<span class="error">#{error 'newpassword' /}</span>
			</td>
		</tr>
		<tr>
			<td class="left">确认密码：</td>
			<td class="right">
				<input type="password" name="repassword" id="repassword" value="${repassword}" />
				<font class="red">*</font>&nbsp;
				<span class="error">#{error 'repassword' /}</span>
			</td>
		</tr>
		#{/form}
		<tr>
			<td class="left">
				<input class="button" type="image" src="@{'/public/images/btn_submit.jpg'}" value="提交" onclick="postData()">
			</td>
			<td class="right">
				<a href="/users/editPassword"><input class="button" type="image" src="@{'/public/images/btn_reset.jpg'}" value="重置"></a>
			</td>
		</tr>
	</table>
	<script language="javascript">
	function postData() {
		$('form').submit();
	}
	</script>
</div>